import request from './../utils/request.js';

/**
 * 活动接口
 */

//活动列表
export function getActivityList(data) {
  return request.get('activity/index', data || {});
}

export function getActivityDetail(id) {
  let data = {}
  if (id) {
    data['id'] = id;
  }
  return request.get('activity/detail', data || {});
}

/**
 * 获取伙伴反馈列表
 */
export function getActivitPostList(data) {
  return request.get('activity/post/index', data);
}

/**
 * 报名互动
 */
export function getActivityFill(data) {
  return request.get('activity/fill', data);
}

/**
 * 报名筛选条件
 */
export function getActivityFilter(data) {
  return request.get('activity/filter', data);
}

/**
 * 获取Task列表
 */
export function getTaskList(data) {
  return request.get('task/index', data);
}

/**
 * Task接口
 */
export function getTaskDetail(data) {
  return request.get('task/detail', data || {});
}

/**
 * 获取挑战内容
 */
export function getTaskContentDetail(id) {
  return request.get('task/content_detail', {id: id});
}

//报名活动
export function signActivity(data) {
  return request.post('activity/sign', data || {});
}

/**
 * 任务挑战列表
 */
export function getTaskContent(data) {
  return request.get('task/content', data || {});
}

/**
 * 广场统计
 */
export function getGcStat(data) {
  return request.get('task/stat', data || {});
}

/**
 * 任务挑战-提交接口
 */
export function addTaskContent(data) {
  return request.post('task/add_content', data || {});
}

/**
 * 任务挑战-提交接口
 */
export function editTaskContent(data) {
  return request.post('task/edit_content', data || {});
}


//点赞
export function taskZan(id) {
  return request.post('task/zan', {id: id});
}
